package com.swagger.swagger.controller;

import com.swagger.swagger.entity.Student;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class HelloController {

    @GetMapping("/hello")
    public String hello(){
        return "hello swagger";
    }
    @ApiOperation("接口描述 name")
    @GetMapping("/helloName")
    public String hello(@ApiParam("用户名字") String name){
        return "hello" + name;
    }

    // 只要接口中返回值有实体类，那么 他就会被扫描刀swagger中去
    @PostMapping("/getStu")
    public Student getStu(){
        return new Student();
    }
}
